<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/resource/js/jquery-3.2.1.js"></script>
</head>
<body>
	<form action="${pageContext.request.contextPath }/toinsert" method="post" enctype="multipart/form-data">
		报销单号<input type="text" name="reimburseId" value="${ri.reimburseId }">
		报销日期<input type="text" name="reimburseDate" value="<fmt:formatDate value="${ri.reimburseDate }" pattern="yyyy-MM-dd"/>">
		
		<br>
		员工编号<input type="text" name="empId" value="${ri.empId }">
		员工姓名<input type="text" name="empName" value="${ri.empName }">
		<br>
		性别
		<input type="radio" name="sex" value="MAN"  ${ri.sex=='MAN'?'checked="checked"':'' }>男
		<input type="radio" name="sex" value="WOMAN" ${ri.sex=='WOMAN'?'checked="checked"':'' }>女
		所属部门
			<select name="deptId" id="dep" data-dep="${ri.deptId }" >
				<option value="">请选择</option>
			</select>
		<br>
		医疗总费用<input type="text" name="totalFee" value="${ri.totalFee }">
		附件<input type="hidden" name="attachment" value="${ri.attachment }">
		<input type="file" name="files">
		<input type="submit" value="上传">
	</form>
	<script type="text/javascript">
	$(function(){
		$.post(
			"${pageContext.request.contextPath }/xiala",
			{},
			function(msg){
				var depid = $("#dep").data("dep");
				for (var i = 0; i < msg.length; i++) {
					if (depid==msg[i].id) {
						$("#dep").append('<option value="'+msg[i].id+'" selected="selected">'+msg[i].name+'</option>');
					}else {
						$("#dep").append('<option value="'+msg[i].id+'">'+msg[i].name+'</option>');
					}
				}
			},
			"json"
		)
	})
	</script>
</body>
</html>